'use strict'

const Controller = require('egg').Controller

class HouseController extends Controller {
    async getHouses() {
        const houses = await this.service.house.house.getHouses()
        const res = {
            status: 0,
            houses,
        }
        this.ctx.body = res
    }
    async getHouseById() {
        const { id } = this.ctx.request.body
        const house = await this.service.house.house.getHouseById(id)
        const res = {
            status: 0,
            house,
        }
        this.ctx.body = res
    }
}

module.exports = HouseController
